//
//  CZQAddJobExperView.m
//  coachmanage
//
//  Created by 众拳科技 on 2018/3/14.
//  Copyright © 2018年 众拳科技. All rights reserved.
//

#import "CZQAddJobExperView.h"

@implementation CZQAddJobExperView
-(id)initWithFrame:(CGRect)frame{
    
    self = [super initWithFrame:frame];
    
    if (self) {
        
        UIScrollView *scrollView = [[UIScrollView alloc] init];
        [self addSubview:scrollView];
        self.scrollView = scrollView;
        
        
        
        /**
         工作单位名称
         */
        CommonInputView *companyInputView = [[CommonInputView alloc] init];
        companyInputView.titleLabel.text = @"工作单位名称*";
        companyInputView.titleTF.placeholder = @"工作单位名称";
        [scrollView addSubview:companyInputView];
        self.companyView = companyInputView;
        
        /**
         岗位名称
         */
        CommonInputView *jobNameInputView = [[CommonInputView alloc] init];
        jobNameInputView.titleLabel.text = @"岗位名称*";
        jobNameInputView.titleTF.placeholder = @"岗位名称";
        [scrollView addSubview:jobNameInputView];
        self.jobNameView = jobNameInputView;
        
        /**
         工作详情
         */
        CommonInputView *jobTitleInputView = [[CommonInputView alloc] init];
        jobTitleInputView.titleLabel.text = @"工作详情*";
        jobTitleInputView.titleTF.placeholder = @"工作详情";
        [scrollView addSubview:jobTitleInputView];
        self.jobTitleView = jobTitleInputView;
        
        /**
         起始时间
         */
        CommonBtnView *startBtnView = [[CommonBtnView alloc] init];
        startBtnView.titleLabel.text = @"起始时间*";
        startBtnView.choseLabel.text = @"选择起始时间";
        startBtnView.choseLabel.textColor = PlaceHoldColor;
        [scrollView addSubview:startBtnView];
        self.startTimeBtnView = startBtnView;
        
        /**
         结束时间
         */
        CommonBtnView *endBtnView = [[CommonBtnView alloc] init];
        endBtnView.titleLabel.text = @"结束时间*";
        endBtnView.choseLabel.text = @"选择结束时间";
        endBtnView.choseLabel.textColor = PlaceHoldColor;
        [scrollView addSubview:endBtnView];
        self.endTimeBtnView = endBtnView;
        
        
        
        [self setConstraints];
    }
    
    return self;
}

-(void)setConstraints{
    
    [self.scrollView mas_remakeConstraints:^(MASConstraintMaker *make) {
        
        make.edges.mas_equalTo(self);
    }];
    
    
    //公司名称
    [self.companyView mas_remakeConstraints:^(MASConstraintMaker *make) {
        
        make.top.mas_equalTo(self);
        
        make.left.width.mas_equalTo(self);
    }];
    
    //工作岗位
    [self.jobNameView mas_remakeConstraints:^(MASConstraintMaker *make) {
        
        make.top.mas_equalTo(self.companyView.mas_bottom);
        
        make.left.width.mas_equalTo(self);
    }];
    
    //起始时间
    [self.startTimeBtnView mas_remakeConstraints:^(MASConstraintMaker *make) {
        
        make.top.mas_equalTo(self.jobNameView.mas_bottom);
        
        make.left.width.mas_equalTo(self);
    }];
    
    //结束时间
    [self.endTimeBtnView mas_remakeConstraints:^(MASConstraintMaker *make) {
        
        make.top.mas_equalTo(self.startTimeBtnView.mas_bottom);
        
        make.left.width.mas_equalTo(self);
    }];
    
    //工作内容
    [self.jobTitleView mas_remakeConstraints:^(MASConstraintMaker *make) {
        
        make.top.mas_equalTo(self.endTimeBtnView.mas_bottom);
        
        make.left.width.mas_equalTo(self);
    }];
    
    
    
}

-(void)layoutSubviews{
    
    self.scrollView.contentSize = CGSizeMake(self.width, self.endTimeBtnView.bottom + CZQ_StatusBarHeight + CZQ_NavigationBarHeight);
}
/*
// Only override drawRect: if you perform custom drawing.
// An empty implementation adversely affects performance during animation.
- (void)drawRect:(CGRect)rect {
    // Drawing code
}
*/

@end
